package com.xcc.shopanim.mode;

import android.app.Activity;

/**
 * ****************************************************
 * 作者 :: rookieCi<1056907550@qq.com>
 * ----------------------------------------------------
 * git :: https://gitee.com/rookieci
 * ----------------------------------------------------
 * 博客 :: http://blog.csdn.net/xcccicishuai
 * ----------------------------------------------------
 * 时间 :: 2019/8/15 Add by rookieCi
 * ----------------------------------------------------
 * 描述 :: BannerMode
 * ****************************************************
 */
public class BannerMode {
    public String id;
    public String bannerName;
    public String jumpId;
    public int jumpType;
    public String jumpUrl;
    public ImageMode pictureKey;
    public long updateTime;
    public transient boolean finally_;//banner列表结尾
    public transient boolean skipSensors;//跳过神策(H5唤起)

    public String getImageUrl() {
        if (pictureKey == null) return null;
        else return pictureKey.getImgUrl();
    }

    public void onClick(Activity activity) {
        /*switch (jumpType) {
            default://不跳转
                break;
            case 1:
                GoodsDetailsActivity.open(activity, jumpId);
                break;
            case 2:
                StoreDetailsActivity.open(activity, jumpId);
                break;
            case 3:
                H5WebViewActivity.open(activity, jumpId, getImageUrl());
                break;
            case 4: {//预告
                List<NewMainVideoMode> modeList = new ArrayList<>();
                modeList.add(new NewMainVideoMode(jumpId, -2));
                VideoRoomPlayActivity.open(activity, modeList, 0);
            }
            break;
            case 5: {//直播
                List<NewMainVideoMode> modeList = new ArrayList<>();
                modeList.add(new NewMainVideoMode(jumpId, 1));
                VideoRoomPlayActivity.open(activity, modeList, 0);
            }
            break;
            case 6: {//回放
                List<NewMainVideoMode> modeList = new ArrayList<>();
                modeList.add(new NewMainVideoMode(jumpId, -1));
                VideoRoomPlayActivity.open(activity, modeList, 0);
            }
            break;
            case 7: {//海报
                if (TextUtils.isEmpty(jumpId)) return;
                H5WebViewActivity.open(activity, jumpId, getImageUrl());
            }
            break;
            case 8: {//H5
                if (TextUtils.isEmpty(jumpUrl)) return;
                H5WebViewActivity.open(activity, jumpUrl, getImageUrl());
            }
            break;
            case 15:// 零元抽奖
            case 9: {//9-零元购列表
                if (isLogin(activity, true)) {
                    ZeroLotteryDetailsActivity.open(activity, jumpId);
                }
            }
            break;
            case 10: {//10-零元购详情
                if (isLogin(activity, true)) {
                    bannerType = 11;
                    ZeroLotteryDetailsActivity.open(activity, jumpId);
                }
            }
            break;
            case 11: {
                bannerType = 12;
                GroupBuyListActivity.open(activity);
            }
            break;
            case 12: {
                bannerType = 13;
                WebViewActivity.open(activity, Clock, activity.getString(R.string.dakafuli), false);
            }
            break;
            case 13: {//邀请有礼
                if (isLogin(activity, true)) InviteUserActivity.open(activity, getImageUrl());
            }
            break;
            case 14: {//14优惠劵列表
                if (isLogin(activity, true)) CouponActivity.open(activity);
            }
            break;
            case 16://进秒杀列表
                FlashSaleActivity.open(activity);
                break;
            case 17://优惠券组 直接请求接口获取优惠券
                if (isLogin(activity, true)) ShopNet.getInstance().giveCoupon(jumpId);
                break;
        }*/
    }

    /*public boolean isLogin(Activity activity, boolean openLogin) {
        boolean login = ShopApp.getInstance().isLogin();
        if (openLogin && !login) {
            NewLoginActivity.open(activity);
        }
        return login;
    }*/
}
